#include "widget.h"
#include "ui_widget.h"
#include <QLineEdit>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->myButton, &QPushButton::clicked, this, &Widget::handleClick);


//    QLineEdit *edit = new QLineEdit(this);
//    edit->setText("edit hello world");
}

void Widget::handleClick()
{
    if(ui->myButton->text() == QString("hello world"))
        ui->myButton->setText("曹飞!");
    else ui->myButton->setText("hello world");
}

Widget::~Widget()
{
    delete ui;
}

